#!/usr/bin/env ruby
# -*- coding: UTF-8 -*-
#-------------------------------------------------------
#	FileName	: 窗口部件.rb
#	Author		：hpy
#	Date		：2021年06月14日
#	Description	：
#-------------------------------------------------------
require "tk"

btnOk = TkVariable.new
ckBtn = TkVariable.new 

root= TkRoot.new{title 'Hey'}
lb1 = TkLabel.new(root) {
	justify 'center'
	text "Hello,World!"
	pack('padx' => 5,
		 'pady' => 5,
		 'side' => 'left')
}

# 按钮
TkButton.new(root) {
	text "check"
	command proc {p ckBtn.value}
	pack( 'side' => 'left' , 
		  'padx' => 5 , 
		  'pady' => 5)
}

# 选择框
TkCheckButton.new(root){
	variable ckBtn
	pack('padx' => 5 , 
		 'pady' => 5, 
		 'side' => 'left')
}

Tk.mainloop